#pragma once
#include <memory>
#include <mutex>
#include <atomic>

class Singleton11
{
protected:
    //私有化构造;
    Singleton11();
    ~Singleton11();

private:

    //禁用拷贝构造和赋值重载
    Singleton11(const Singleton11& hs) = delete;
    Singleton11& operator=(const Singleton11& hs) = delete;
public:
    

    //获取实例;
    static Singleton11* GetInstance();

    //释放实例;
    static void Destory();

    //测试函数;
    void Display();

private:
    //声明成员变量;
    static std::mutex m_Mtx;
    static std::atomic<Singleton11*> m_pInstance;
};


